import 'package:flutter_test/flutter_test.dart';

void main() {
  group('Wakelock', () {
    test('should enable wakelock', () async {
      Wakelock wakelock = Wakelock();
      wakelock.toggle(on: true);
      expect(wakelock.isEnabled, true);
    });

    test('should disable wakelock', () async {
      Wakelock wakelock = Wakelock();
      wakelock.toggle(on: false);
      expect(wakelock.isEnabled, false);
    });
  });
}

class Wakelock {
  bool _isEnabled = false;

  void toggle({required bool on}) {
    _isEnabled = on;
  }

  bool get isEnabled => _isEnabled;
}
